﻿using System.Collections.Generic;
using System.Web.Mvc;

namespace NetSurveillance.WebApp.Exts
{
    public class ViewHelper
    {
        static readonly SelectListItem[] _emptySelectList = new SelectListItem[] { };

        public static IEnumerable<SelectListItem> EmptySelectList
        {
            get { return _emptySelectList; }
        }

        public static SelectList SetSelectValue(SelectList list, object selectedValue)
        {
            return new SelectList(list.Items, list.DataValueField, list.DataTextField, selectedValue);
        }
    }
}